package com.itheima.controller;

import com.itheima.common.PageBean;
import com.itheima.common.Result;
import com.itheima.service.OperatorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OperatorLogController {

    @Autowired
    private OperatorLogService operatorLogService;

    /**
     * 日志的分页查询
     * @return
     */
    @GetMapping("/brandLog/selectByPage")
    public Result findByPage(@RequestParam(defaultValue = "1") Integer page,
                             @RequestParam(defaultValue = "5") Integer pageSize){

        PageBean pageBean = operatorLogService.findByPage(page, pageSize);
        return Result.ok("日志分页查询成功！",pageBean);
    }
}
